package cn.csc.module.pay.controller.app.order.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigInteger;
import java.time.LocalDateTime;

/**
 * 支付订单创建
 * @author liuchuang
 * @version 1.0
 * @date 2024/9/3 15:22
 * @modify
 */
@ApiModel("用户 APP - 支付订单创建 Request VO")
@Data
public class AppPayOrderCreateReqVO {

    /**
     * 应用编号
     */
    @ApiModelProperty(value = "应用编号", required = true, example = "1668453991799336981")
    @NotNull(message = "应用编号不能为空")
    private BigInteger appId;
    /**
     * 用户 IP
     */
    @ApiModelProperty(value = "用户 IP", required = true, example = "12.123.12.12")
    @NotEmpty(message = "用户 IP 不能为空")
    private String userIp;

    // ========== 商户相关字段 ==========

    /**
     * 外部商家用戶id
     */
    @ApiModelProperty(value = "外部商家用戶id", example = "12123")
    private String appUserId;
    /**
     * 商户订单编号
     */
    @ApiModelProperty(value = "商户订单编号", required = true, example = "csczh1212332421")
    @NotEmpty(message = "商户订单编号不能为空")
    private String merchantOrderId;
    /**
     * 商品标题
     */
    @ApiModelProperty(value = "商品标题", required = true, example = "商品标题")
    @NotEmpty(message = "商品标题不能为空")
    @Length(max = 32, message = "商品标题不能超过 32")
    private String subject;
    /**
     * 商品描述
     */
    @ApiModelProperty(value = "商品描述", required = true, example = "商品描述")
    @NotEmpty(message = "商品描述信息不能为空")
    @Length(max = 128, message = "商品描述信息长度不能超过128")
    private String body;

    // ========== 订单相关字段 ==========

    /**
     * 支付金额，单位：分(实付)
     */
    @ApiModelProperty(value = "支付金额，单位：分(实付)", required = true, example = "1200")
    @NotNull(message = "支付金额不能为空")
    @DecimalMin(value = "0", inclusive = false, message = "支付金额必须大于零")
    private Integer amount;

    /**
     * 购物卡支付金额，单位：分
     */
    @ApiModelProperty(value = "购物卡支付金额，单位：分")
    private Integer cardPayAmount;
    /**
     * 优惠金额，单位：分
     */
    @ApiModelProperty(value = "优惠金额，单位：分")
    private Integer couponAmount;

    /**
     * 支付过期时间
     */
    @ApiModelProperty(value = "支付过期时间", required = true, example = "2023-04-12 10:10:48")
    @NotNull(message = "支付过期时间不能为空")
    private LocalDateTime expireTime;

    /**
     * 订单类型
     */
    @ApiModelProperty(value = "0:直销 5:分账(分账必填,否则走直销),6:分账(代付) 7:分账(内部订单)")
    @NotNull(message = "订单类型不能为空")
    private Integer orderType;

}
